/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: XMQ
 * Date: 2022-06-16
 * Time: 15:58
 */
class Plate{
    public Plate(int i){
        System.out.println("plate Constructor");
    }
}
class DinnerPlate extends Plate{
    public DinnerPlate(int i) {
        super(i);
        System.out.println("dinnerplate Constructor");
    }
}
class Utensil{
    public Utensil(int i) {
        System.out.println("Utensil Constructor");
    }
}
class Spoon extends Utensil{
    public Spoon(int i) {
        super(i);
        System.out.println("Spoon Constructor");
    }
}
class Custom{
    public Custom(int i) {
        System.out.println("Custom Constructor");
    }
}
public class TestDemo2 extends Custom{
    //组合和继承结合
    private Spoon sp;
    private DinnerPlate pl;

    public TestDemo2(int i) {
        super(i);
        sp = new Spoon(i+1);
        pl = new DinnerPlate(i+3);
    }

    public static void main(String[] args) {
        TestDemo2 demo2 = new TestDemo2(9);
    }
}
